<#include "header.htm"/>

<div id="tabs">
			<ul>
				<li><a href="${JForumContext.encodeURL("/admBase/login")}"><span>${I18n.getMessage("Admin.general")}</span></a></li>
	
			
				<li><a href="${contextPath}/adminGroups/list${extension}"><span>${I18n.getMessage("Admin.groups")}</span></a></li>
				<li><a href="${contextPath}/adminUsers/list${extension}"><span>${I18n.getMessage("Admin.users")}</span></a></li>
				<li><a href="${contextPath}/adminCategories/list${extension}"><span>${I18n.getMessage("Admin.categories")}</span></a></li>				
				<li><a href="${contextPath}/adminForums/list${extension}"><span>${I18n.getMessage("Admin.forums")}</span></a></li>
				<li><a href="${contextPath}/adminModeration/list${extension}"><span>${I18n.getMessage("Admin.approving")}</span></a></li>
			
				<li><a href="${contextPath}/adminRankings/list${extension}"><span>${I18n.getMessage("Admin.rankings")}</span></a></li>				
				<li><a href="${contextPath}/adminBanning/list${extension}"><span>${I18n.getMessage("Admin.banning")}</span></a></li>
				
				
				
				
				<li><a href="${contextPath}/adminConfig/list${extension}"><span>${I18n.getMessage("Admin.configurations")}</span></a></li>
			
				<li><a href="${contextPath}/adminSmilies/list${extension}"><span>${I18n.getMessage("Admin.smilies")}</span></a></li>
			
				<li><a href="${contextPath}/adminSearchStats/list${extension}"><span>${I18n.getMessage("Admin.search")}</span></a></li>
			
				<li id="activetab"><a href="${contextPath}/adminAttachments/configurations${extension}"><span>${I18n.getMessage("Admin.attachments")}</span></a></li>
			
				<li><a href="${contextPath}/adminCache/list${extension}"><span>${I18n.getMessage("Admin.cache")}</span></a></li>
			
			</ul>
</div>
<div id="acp">
		<div class="panel">
			<span class="corners-top"><span></span></span>
				<div id="content">
                <div id="toggle">
						<a id="toggle-handle" accesskey="m" title="Hide or display the side menu" onclick="switch_menu(); return false;" href="#"></a>
				</div>
				<div id="menu">
						
						<ul>
						
							<li class="header">${I18n.getMessage("Admin.attachments")}</li>
							
								<li><a href="${contextPath}/adminAttachments/configurations${extension}"><span>${I18n.getMessage("Admin.attachConfigurations")}</span></a></li>
								
								<li id="activemenu"><a href="${contextPath}/adminAttachments/quotaLimit${extension}"><span>${I18n.getMessage("Admin.attachQuota")}</span></a></li>
								
								<li><a href="${contextPath}/adminAttachments/extensionGroups${extension}"><span>${I18n.getMessage("Admin.attachExtensionGroups")}</span></a></li>
								
								<li><a href="${contextPath}/adminAttachments/extensions${extension}"><span>${I18n.getMessage("Admin.attachExtensions")}</span></a></li>
	

	
								
								
						</ul>
					</div>
				    <div id="main">
								


<#setting number_format = "#"/>
<#import "macros/group_macros.ftl" as lib>



<form accept-charset="${encoding}" name="form" action="${contextPath}/jforum${extension}" method="post">
	<input type="hidden" name="action" value="quotaLimitSave" />
	<input type="hidden" name="module" value="${moduleName}" />



<table cellspacing="1">
            <caption>${I18n.getMessage("AdminAttachments.quotaTitle")}</caption>
    
	<tr>
		<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaDescription")}</th>
		<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaFilesize")}</th>
	</tr>

	<tr>
		<td style="text-align: center;"><input type="text" size="20" maxlength="25" name="quota_description" value=""/></td>
		<td style="text-align: center;">
			<input type="text" size="8" maxlength="15" name="max_filesize"/> 
			<select name="type">
				<option value="1">KB</option>
				<option value="2" selected>MB</option>
			</select>
		</td>
	</tr>
</table>

<fieldset class="submit-buttons">
		<input class="button2" type="submit" value="${I18n.getMessage("submit")}">
</fieldset>
</form>

	<!-- List existing entries -->
	<#if (quotas.size() > 0)>
	<form accept-charset="${encoding}" name="form" action="${contextPath}/jforum${extension}" method="post">
	<input type="hidden" name="action" value="quotaLimitUpdate" />
	<input type="hidden" name="module" value="${moduleName}" />
	<input type="hidden" name="total_records" value="${quotas.size()}"/>

<table cellspacing="1">
    
		<tr>
			<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaDescription")}</th>
			<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaFilesize")}</th>

			<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaDelete")}</th>
		</tr>

		<#assign count = 0/>
		<#list quotas as q>
		 <#if q_index % 2 == 0>
			<#assign rowColor = "row1">
		<#else>
			<#assign rowColor = "row2">
		</#if>
			<input type="hidden" name="id_${count}" value="${q.id}">
			<tr class="${rowColor}">
				<td style="text-align: center;">
					<input type="text" size="20" maxlength="25" name="quota_desc_${count}" value="${q.description}" />
				</td>

				<td style="text-align: center;">
					<input type="text" size="8" maxlength="15" name="max_filesize_${count}" value="${q.size}"/> 
					<select name="type_${count}">
						<option value="1" <#if q.type == 1>selected</#if>>KB</option>
						<option value="2" <#if q.type == 2>selected</#if>>MB</option>
					</select>
				</td>
				<td style="text-align: center;"><input type="checkbox" name="delete" value="${q.id}" /></td>
			</tr>
			<#assign count = count + 1/>
		</#list>
</table>

<fieldset class="submit-buttons">
		<input class="button2" type="submit" value="${I18n.getMessage("submit")}">
</fieldset>
	</#if>
</form>
<br />

<#macro quotaCombo n quotaId>
	<select name="limit_${n}"/>
	<option value="">-- ${I18n.getMessage("AdminAttachments.quotaChooseLimit")} --</option>
	<#list quotas as q>
		<option value="${q.id}" <#if q.id == quotaId>selected</#if>>${q.description}</option>
	</#list>
	</select>
</#macro>

<form accept-charset="${encoding}" name="form" action="${contextPath}/jforum${extension}" method="post">
<input type="hidden" name="action" value="quotaGroupsSave" />
<input type="hidden" name="module" value="${moduleName}" />
<input type="hidden" name="total_groups" value="${groups.size()}">

<table cellspacing="1">
        <caption>${I18n.getMessage("AdminAttachments.groupPermission")}</caption>
		<tr>
			<th style="text-align: center;">${I18n.getMessage("AdminAttachments.groupName")}</th>
			<th style="text-align: center;">${I18n.getMessage("AdminAttachments.quotaType")}</th>
		</tr>
		
	<#assign row = 1/>
	<#assign counter = 0/>
	<#list groups as g>
		<#if g_index % 2 == 0>
			<#assign rowColor = "row1">
		<#else>
			<#assign rowColor = "row2">
		</#if>
	    
		<tr class="${rowColor}">
			<#assign x = selectedList.clear()/>
			<#if groupQuotas.get(g.id)?exists>
				<#assign x = selectedList.add(g.id)/>
			</#if>

			<td style="text-align: center;"><@lib.selectFieldGroups "group_" + counter, groups, 0, false, selectedList/></td>
			<td style="text-align: center;"><@quotaCombo counter, groupQuotas.get(g.id)?default(0)/></td>
		</tr>

		<#if row == 2><#assign row = 1/></#if>
		<#assign row = row + 1/>
		<#assign counter = counter + 1/>
	</#list>
</table>

<fieldset class="submit-buttons">
		<input class="button2" type="submit" value="${I18n.getMessage("submit")}">
</fieldset>
</form>

</div>
</div>
	<span class="corners-bottom"><span></span></span>
</div>
</div>

<#include "bottom.htm"/>